using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

using SchemaProvider;
using Kenly.DBFramework;

namespace Sql2005SchemaProvider
{
    public class Sql2005SchemaLoader : SchemaLoaderBase
    {

        private IDatabase _database = null;


        protected override IDatabase Database
        {
            get
            {
                if (_database == null)
                {
                    _database = DatabaseFactory.CreateSqlServerDatabase();
                }
                return _database;
            }
            set
            {
                _database = value;
            }
        }


        public override void ShowAboutBox()
        {
            Sql2005AboutBox sql2005AboutBox = new Sql2005AboutBox();
            sql2005AboutBox.ShowDialog();
        }

        protected override string ListIdentitiesSql()
        {
            return Sql2005CommandUtility.ListIdentities();
        }

        protected override string ListPrimaryKeysSql()
        {
            return Sql2005CommandUtility.ListPrimaryKeys();
        }

        protected override string ListForeignKeySql()
        {
            return Sql2005CommandUtility.ListForeignKey();
        }

        protected override string ListProcedureParametersSql()
        {
            return Sql2005CommandUtility.ListProcedures();
        }

        protected override string ListTableNamesSql()
        {
            return Sql2005CommandUtility.ListTableNames();
        }

        protected override string ListViewNamesSql()
        {
            return Sql2005CommandUtility.ListViewNames();
        }
    }
}
